package edu.wpi.first.wpilibj.swarm;

import edu.wpi.first.wpilibj.Gyro;

public class GyroInitializer implements Runnable {
	Gyro gyro;
	int  input;
	
	public GyroInitializer(int channel) {
		input = channel;
		gyro  = null;
	}
	
	void init() {
		new Thread(this).start();
	}
	
	Gyro getGyro() {
		while (gyro == null) {
			try {
				Thread.sleep(100);
			} catch (Exception ex) {}
		}
		return gyro;
	}

	public void run() {
		gyro = new Gyro(input);
	}
}
